package com.cykj.controller;

import com.cykj.dto.ResponseDTO;
import com.cykj.service.IGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Project:JDMS
 * Package:com.cykj.controller
 *
 * @Description:
 * @Author:其一
 * @CreateTime: 2025-07-30-10-43
 */
@RestController
@RequestMapping("/good")
public class GoodController {
    @Autowired
    private IGoodService goodService;

    @RequestMapping("/getAll")
    private ResponseDTO getAllGood(){
        return goodService.getAllGood();
    }

    @PutMapping("/updateGoodStock")
    public ResponseDTO updateGoodStock(@RequestParam("buyCount") Integer count,@RequestParam("goodId") Integer goodId){
        return goodService.updateGoodStock(count,goodId);
    }

    @RequestMapping("/test")
    public String test(){
        return "熔断了";
    }
}
